/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package br.com.deployment.manager;

import java.io.IOException;
import java.io.Serializable;
import java.util.logging.Level;
import java.util.logging.Logger;
import javax.faces.bean.ManagedBean;
import javax.faces.bean.SessionScoped;
import javax.faces.context.FacesContext;
import javax.servlet.ServletContext;
   
/**
 *
 * @author roniere
 */
@ManagedBean
@SessionScoped
public class ManagerLayout implements Serializable{
    String page;

    public String addPage(String type) {
        return "indexImovel.xhtml";
    }
    public String getPage() {
        return page;
    }

    public void setPage(String page) {
        this.page = page;
    }
    
     public void logout() throws IOException {
        FacesContext facesContext = FacesContext.getCurrentInstance();
        ServletContext servletContext = (ServletContext) facesContext.getExternalContext().getContext();
        String contextName = servletContext.getContextPath();
        facesContext.responseComplete();
        facesContext.getExternalContext().invalidateSession();
        facesContext.getExternalContext().redirect("/Cartorio-war/login.jsp");
//        return "login.jsp";
    }
    
    
    
    
}
